
#include "Button.h"
#include "ClickEvent.h"

Button::Button(const char* name)
    : observer::Component(new Publisher()), name_(const_cast<char*>(name))
{

}

void Button::Click()
{
  observer::Component::notify(new ClickEvent(this->name_, "按钮被点击了"));
}

Button::~Button() = default;